import { IDataWithError } from '@/service/typing/service-typing'
import { IListMessageParam, IMessageInfo, IMessageService } from '@/service/typing/service/IMessageService'
import { HttpTransfer } from '../transfer/transfer'
import { IMessageURL } from '../transfer/urls/message'

export class MessageService implements IMessageService {
  constructor(private readonly http: HttpTransfer, private readonly url: IMessageURL) {}

  listMessage(param: IListMessageParam): Promise<IDataWithError<IMessageInfo[], any>> {
    return this.http.request(this.url.listMessage, param)
  }
}
